local fanjian = fk.CreateSkill {

  name = "joyex__fanjian",

  tags = {  },

}



fanjian:addEffect("active", {
  name = "joyex__fanjian",
  prompt = "#joyex__fanjian",
  can_use = function(self, player)
    return player:usedSkillTimes(fanjian.name, Player.HistoryPhase) == 0 and not player:isKongcheng()
  end,
  card_filter = function(self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select):getSuitString() ~= "nosuit"
  end,
  target_filter = function(self, player, to_select, selected)
    return #selected == 0 and to_select ~= player
  end,
  target_num = 1,
  card_num = 1,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local suit = Fk:getCardById(effect.cards[1]):getSuitString()
    local choice = room:askForChoice(target, {"spade", "heart", "club", "diamond"}, fanjian.name,"反间：请猜测"..Fk:translate(player.general).."声明的花色，若猜对额外摸一张牌,最后受到对方的一点伤害。:"..player.id)
    if suit == choice and target:isAlive() then
      target:drawCards(1,fanjian.name)
    end
    if target.dead then return end
    room:damage{
        from = player,
        to = target,
        damage = 1,
        skillName = fanjian.name,
    }
  end,
})

return fanjian